home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / umich / utils / ctv201.arc / CT.DOC next >
Text File  |  1988-03-10  |  7KB  |  199 lines

  1.  
  2.  
  3. Mar  4 01:18 1988  ct.doc Page 1
  4.  
  5.  
  6.     You may have noticed that when you copy files with the Desktop (by
  7. dragging icons), the new files created by the copy have a timestamp equal to
  8. the current date and time, rather than the timestamp from the source file. 
  9.  
  10.     For many situations, this is not a problem.  However, it is often
  11. useful to maintain this timestamp when copying.  Since many command-line
  12. copying programs (typically named 'cp' after the Unix command) for the ST
  13. are also plagued with this problem (the ones supplied with "Gulam" and
  14. Beckemeyer's Micro/MT C-Shell being exceptions), I wrote my own, and
  15. called it CT, for 'copy with timestamp'. 
  16.  
  17.     It wasn't until after I wrote CT that I discovered that Gulam and the
  18. MT Csh had solved my problem.  So why bother continuing to update and improve
  19. CT, you ask?  Mainly because of the additional capabilities that I've added
  20. since the original version, namely:
  21.  
  22.     - now copies whole directory trees with the '-r' option.
  23.     - allows selective backup of files with the '-b' option.  (e.g.: you're
  24.       working on a ramdisk, and saved all your files to floppy 20 minutes
  25.       ago.  Before you run your test program, you want to save all the
  26.       files have changed since you last saved them to floppy.
  27.       "ct -b * a:\" will do this.)
  28.     - can request user verification if the destination file exists
  29. ****    - accepts wildcard file specifications, so that CT may be called up
  30.       from the Desktop.  (Or from the Megamax graphical shell, or from
  31.       within Flash, for instance).  (** See description of wildcards,
  32.       below).
  33.     - also, if called from the Desktop, waits for a keypress before
  34.       exiting.
  35.  
  36.     Now, Gulam does have a '-r' option; however it doesn't seem to copy the
  37. actual directory structure, but only the files themselves that are contained
  38. in the directories.  With CT, if you specify
  39.     ct -r a:\{bin,lib,work} c:\
  40. then the 3 directories themselves, as well as their contents, will end up on
  41. c:\ (just like it works on the desktop when you drag folders).
  42.  
  43.     GEMDOS BUG 'FIXED': You may also have noticed (if you work with
  44. floppies a lot from command shells) the following problem: you are working
  45. from a ramdisk directory, and you want to copy a file from a floppy onto the
  46. ramdisk.  You remove the floppy that is in the drive, and insert a new floppy. 
  47. Then you type, "cp a:\folder\file.nam c:\" or some such thing, and the copy
  48. fails, with "can't open a:\folder\file.nam".  If you then type "ls a:\" and
  49. repeat the copy command, it will work.  This problem is fixed in CT.  GEMDOS
  50. for some reason won't access files in subdirectories when a disk is changed,
  51. _until_ it has a look at the root directory on the new floppy.  I basically
  52. force it to do this if I can't open the file. 
  53.  
  54.     CT is also fairly robust:
  55.     - when expanding wildcards, CT can handle up to 2000 files in total.
  56.       When copying directories, CT can handle up to 2000 files rooted in
  57.       one directory.  This limit may easily be increased by modifying
  58.       a #define in the source.
  59.     - will allocate a very large buffer (I have it #define'd to try for
  60.       500K).  This really helps when copying from a: to b: with one
  61.       drive (although be warned: there are still a couple of swaps per
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69. Mar  4 01:18 1988  ct.doc Page 2
  70.  
  71.  
  72.       file).
  73.     - if you are working under the MT Csh and you want to use CT in the
  74.       background, then you can specify the '-m' option, to restrict CT
  75.       from hogging all available memory.
  76.     - when performing a recursive directory copy, CT checks for stack
  77.       overflow.
  78.     - if a file is not successfully copied, CT deletes the destination
  79.       file. 
  80.  
  81. Wildcards:
  82. ==========
  83. *    - match with any string of characters.
  84. ?    - match with any single character.
  85. []    - match any one character within the brackets.  Ranges of characters
  86.       may be specified as follows: [a-zA-z] meaning any lower or upper
  87.       case alphabetic character.
  88. {}    - match any of the specified groups of characters, e.g.
  89.       {word1,word2,word3} will match with 'word1', 'word2', and 'word3'.
  90.  
  91.     Some examples:
  92.     a:\{bin,lib,include}\*.c
  93.         - matches with all '.c' files in a:\bin, a:\lib, and
  94.           a:\include
  95.     *
  96.         - matches with all filenames, with or without extensions.
  97.     c:\work\*.[ch]
  98.         - matches with all '.c' and '.h' files in c:\work
  99.     [d-q]*
  100.         - matches with all files beginning with the letters 'd'
  101.           through 'q'.
  102.  
  103. Interesting tidbits:
  104. ====================
  105. (more than you care to know, probably, but hey, this is my moment on the
  106. soapbox so let me enjoy it...)
  107.  
  108.     - In testing CT, I created a directory tree containing around 2,000
  109.       files of zero length, strewn among several directories.  CT handles
  110.       this fine, thank you, but GEMDOS just died disgracefully when I
  111.       tried to delete these folders.  Not even a warm boot would
  112.       resuscitate the ramdisk!
  113.  
  114.     - An easy (but not flawless) way to determine if a program has been
  115.       called from the Desktop is simply to check if argv[0] is an empty
  116.       string.  Most ST shells (msh, Gulam, MT Csh) will set argv[0] equal
  117.       to the program name, i.e., "ct".  However, if a user is, er, 'using'
  118.       a command shell that doesn't follow this standard practice, CT will
  119.       assume that it is being called from the desktop, and will wait for a
  120.       keypress before exiting. 
  121.  
  122.     - If you go through the source code, you can't miss the inelegant
  123.       method I use to allocate as large a buffer as possible.  It's very
  124.       evident that I'm not using the standard Malloc(-1L) method.  Why?
  125.       Apparently (from all I could tell) you simply cannot mix Malloc()
  126.       and MWC's malloc() routines in the same program.  As soon as Malloc()
  127.       is called, malloc() will refuse to allocate any memory.  Since
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135. Mar  4 01:18 1988  ct.doc Page 3
  136.  
  137.  
  138.       I doubt that Malloc() will perform 2000 allocations (I think that
  139.       the fixed limit is well below that), I'm forced to use malloc().
  140.  
  141.     - Cconws( NULL ) seems to print one backquote ("`").
  142.  
  143.     - When run from the desktop as a .ttp program, the first tab printed
  144.       doesn't seem to behave itself.  Just try running ct.ttp with no
  145.       params, and you'll see what I mean.  (Although I have some very
  146.       old ROMS, so it your mileage may vary).
  147.  
  148.     - Fread() doesn't seem to return an error code.  Even if I get the
  149.       "Data on the disk in drive A may be damaged..." alert box, I don't
  150.       get a negative return code from Fread().
  151.  
  152.  
  153.  
  154.     EMail suggestions or bug reports (not that there _are_ any :o) ) to:
  155.  
  156.     Usenet: jafischer@lily.waterloo.edu (until May 1988)
  157.         or: ...{ihnp4,allegra,decvax,utzoo,utcsri}!watmath!lily!jafischer
  158.     Compuserve: 76626,210
  159.  
  160.     NOTE: CT is in the public domain.
  161.  
  162.     DISCLAIMER: (just to be safe) I shall not be held liable for any
  163.     damages incurred through use or misuse of CT.  There.
  164.  
  165.  
  166.                 - Jonathan Fischer.
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.